<!--
  This file is a part of the open-eBackup project.
  This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
  If a copy of the MPL was not distributed with this file, You can obtain one at
  http://mozilla.org/MPL/2.0/.
  
  Copyright (c) [2024] Huawei Technologies Co.,Ltd.
  
  THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
  EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
  MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
  -->


<!--
  This file is a part of the open-eBackup project.
  This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
  If a copy of the MPL was not distributed with this file, You can obtain one at
  http://mozilla.org/MPL/2.0/.
  
  Copyright (c) [2024] Huawei Technologies Co.,Ltd.
  
  THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
  EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
  MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
  -->

<!--
  This file is a part of the open-eBackup project.
  This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
  If a copy of the MPL was not distributed with this file, You can obtain one at
  http://mozilla.org/MPL/2.0/.
  
  Copyright (c) [2024] Huawei Technologies Co.,Ltd.
  
  THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
  EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
  MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
  -->

<!--
  This file is a part of the open-eBackup project.
  This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
  If a copy of the MPL was not distributed with this file, You can obtain one at
  http://mozilla.org/MPL/2.0/.
  
  Copyright (c) [2024] Huawei Technologies Co.,Ltd.
  
  THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
  EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
  MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
  -->

<!DOCTYPE html
  PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en-us" xml:lang="en-us">
<head>
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
   
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="DC.Type" content="topic">
<meta name="DC.Title" content="Step 1: Enabling MySQL/MariaDB Database Permission">
<meta name="product" content="">
<meta name="DC.Relation" scheme="URI" content="en-us_topic_0000001792343590.html">
<meta name="prodname" content="">
<meta name="version" content="">
<meta name="brand" content="30-OceanProtect Appliance 1.5.0-1.6.0 Help Center">
<meta name="DC.Publisher" content="20240608">
<meta name="DC.Format" content="XHTML">
<meta name="DC.Identifier" content="EN-US_TOPIC_0000001839142693">
<meta name="DC.Language" content="en-us">
<link rel="stylesheet" type="text/css" href="public_sys-resources/commonltr.css">
<title>Step 1: Enabling MySQL/MariaDB Database Permission</title>
</head>
<body style="clear:both; padding-left:10px; padding-top:5px; padding-right:5px; padding-bottom:5px"><a name="EN-US_TOPIC_0000001839142693"></a><a name="EN-US_TOPIC_0000001839142693"></a>

<h1 class="topictitle1">Step 1: Enabling MySQL/MariaDB Database Permission</h1>
<div><p>Before executing a MySQL/MariaDB backup job, you need to enable the permission of the corresponding MySQL/MariaDB version. Otherwise, registration, backup, or restoration will fail. The MySQL 8.0.11 database and openEuler 22.03 are used as examples in this section. The commands may vary depending on the database and OS versions. Contact O&amp;M personnel or database administrators for the commands.</p>
<div class="section"><h4 class="sectiontitle">Procedure</h4><ol><li id="EN-US_TOPIC_0000001839142693__en-us_topic_0000001497361525_li188641010427"><span>Log in to the MySQL/MariaDB host as user <strong id="EN-US_TOPIC_0000001839142693__en-us_topic_0000001497361525_b1088919241313">root</strong> and run the <strong id="EN-US_TOPIC_0000001839142693__en-us_topic_0000001497361525_b253942933412">mysql -uroot -p</strong><em id="EN-US_TOPIC_0000001839142693__en-us_topic_0000001497361525_i14934102923410">Password</em> command to log in to the MySQL/MariaDB database.</span></li><li id="EN-US_TOPIC_0000001839142693__en-us_topic_0000001497361525_li12801332115118"><span>Run the <strong id="EN-US_TOPIC_0000001839142693__en-us_topic_0000001497361525_b1328393213513">CREATE USER '</strong><em id="EN-US_TOPIC_0000001839142693__en-us_topic_0000001497361525_i1328333255118">name</em><strong id="EN-US_TOPIC_0000001839142693__en-us_topic_0000001497361525_b142831432115115">'@'</strong><strong id="EN-US_TOPIC_0000001839142693__en-us_topic_0000001497361525_b27081312638">127.0.0.1</strong><strong id="EN-US_TOPIC_0000001839142693__en-us_topic_0000001497361525_b11283113225110">' IDENTIFIED BY '</strong><em id="EN-US_TOPIC_0000001839142693__en-us_topic_0000001497361525_i44353389320">password</em><strong id="EN-US_TOPIC_0000001839142693__en-us_topic_0000001497361525_b8283133245111">';</strong> command to create a user.</span></li><li id="EN-US_TOPIC_0000001839142693__en-us_topic_0000001497361525_li3310147525"><span>Run the following commands in sequence to enable the remote login permission of 127.0.0.1 of the MySQL/MariaDB database:</span><p><ol type="a" id="EN-US_TOPIC_0000001839142693__en-us_topic_0000001497361525_ol173593501938"><li id="EN-US_TOPIC_0000001839142693__en-us_topic_0000001497361525_li4239141921418">Run the <strong id="EN-US_TOPIC_0000001839142693__en-us_topic_0000001497361525_b11870950181220">G</strong><strong id="EN-US_TOPIC_0000001839142693__en-us_topic_0000001497361525_b1174351662913">RANT ALL PRIVILEGES ON *.* TO '</strong><em id="EN-US_TOPIC_0000001839142693__en-us_topic_0000001497361525_i1730820172295">name</em><strong id="EN-US_TOPIC_0000001839142693__en-us_topic_0000001497361525_b11743101652915">'@'127.0.0.1'</strong><strong id="EN-US_TOPIC_0000001839142693__en-us_topic_0000001497361525_b20271890214"> WITH GRANT OPTION;</strong> command to enable the remote login permission of 127.0.0.1.</li><li id="EN-US_TOPIC_0000001839142693__en-us_topic_0000001497361525_li10955327111418">Run the <strong id="EN-US_TOPIC_0000001839142693__en-us_topic_0000001497361525_b10660347151410">FLUSH PRIVILEGES;</strong> command to update the remote login permission of MySQL/MariaDB.</li></ol>
</p></li><li id="EN-US_TOPIC_0000001839142693__en-us_topic_0000001497361525_li1031195615112"><span>Run the following command to enable the permission of the corresponding database version for the user:</span><p><ul id="EN-US_TOPIC_0000001839142693__en-us_topic_0000001497361525_ul0622182323520"><li id="EN-US_TOPIC_0000001839142693__en-us_topic_0000001497361525_li26227234359">MySQL 5.<em id="EN-US_TOPIC_0000001839142693__en-us_topic_0000001497361525_i19579151163210">x</em>:<pre class="screen" id="EN-US_TOPIC_0000001839142693__en-us_topic_0000001497361525_screen5134135312354">GRANT RELOAD, PROCESS, REPLICATION CLIENT, SUPER, LOCK TABLES  ON *.* TO '<em id="EN-US_TOPIC_0000001839142693__en-us_topic_0000001497361525_i044813363">name</em>'@'127.0.0.1';
FLUSH PRIVILEGES;</pre>
</li><li id="EN-US_TOPIC_0000001839142693__en-us_topic_0000001497361525_li262215238353">MySQL 8.<em id="EN-US_TOPIC_0000001839142693__en-us_topic_0000001497361525_i115106176327">x</em>:<pre class="screen" id="EN-US_TOPIC_0000001839142693__en-us_topic_0000001497361525_screen1829411173364">GRANT BACKUP_ADMIN, SELECT, RELOAD, PROCESS, SUPER, LOCK TABLES  ON *.* TO '<em id="EN-US_TOPIC_0000001839142693__en-us_topic_0000001497361525_i31132289360">name</em>'@'127.0.0.1';
FLUSH PRIVILEGES;</pre>
</li><li id="EN-US_TOPIC_0000001839142693__en-us_topic_0000001497361525_li46228239353">MariaDB 10.5/10.6/10.7:<pre class="screen" id="EN-US_TOPIC_0000001839142693__en-us_topic_0000001497361525_screen186673053617">GRANT RELOAD, PROCESS, BINLOG MONITOR, SUPER, LOCK TABLES ON *.* TO '<em id="EN-US_TOPIC_0000001839142693__en-us_topic_0000001497361525_i77531146193610">name</em>'@'127.0.0.1';
FLUSH PRIVILEGES;</pre>
</li><li id="EN-US_TOPIC_0000001839142693__en-us_topic_0000001497361525_li1862314236351">MariaDB 10.3/10.4:<pre class="screen" id="EN-US_TOPIC_0000001839142693__en-us_topic_0000001497361525_screen153740491365">GRANT RELOAD, PROCESS, REPLICATION CLIENT, SUPER, LOCK TABLES ON *.* TO '<em id="EN-US_TOPIC_0000001839142693__en-us_topic_0000001497361525_i2962200163714">name</em>'@'127.0.0.1';
FLUSH PRIVILEGES;</pre>
</li><li id="EN-US_TOPIC_0000001839142693__en-us_topic_0000001497361525_li106231723113511">MariaDB 10.2:<pre class="screen" id="EN-US_TOPIC_0000001839142693__en-us_topic_0000001497361525_screen17113103717">GRANT USAGE ON *.* TO '<em id="EN-US_TOPIC_0000001839142693__en-us_topic_0000001497361525_i8577816193720">name2</em>'@'127.0.0.1' IDENTIFIED BY '<em id="EN-US_TOPIC_0000001839142693__en-us_topic_0000001497361525_i5577161663715">password</em>';
GRANT RELOAD,PROCESS,SUPER,REPLICATION CLIENT,LOCK TABLES ON *.* TO '<em id="EN-US_TOPIC_0000001839142693__en-us_topic_0000001497361525_i558011615371">name</em>'@'127.0.0.1';
FLUSH PRIVILEGES;</pre>
</li></ul>
</p></li></ol>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="en-us_topic_0000001792343590.html">Backing Up MySQL/MariaDB Database</a></div>
</div>
</div>

<div class="hrcopyright"><hr size="2"></div><div class="hwcopyright">Copyright &copy; Huawei Technologies Co., Ltd.</div></body>
</html>